﻿//Expr.h
#pragma once
#include "Base_Node.h"
#include "Lexer.h"
#include <iostream>
using namespace std;
class Expr {
public:
	Expr(char*);
	double eval()const { return rootNode->getValue(); }	//返回值
	void print()const { string str = rootNode->generateInfix(); cout << str; }		//中缀
	void print_pre()const { string str = rootNode->generatePrefix();  cout << str; }	//前缀
	void print_post()const { string str = rootNode->generatePostfix();  cout << str; }	//后缀
private:
	Base_Node* rootNode;
};
